<%@tag pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@tag import="org.springframework.context.ApplicationContext"%>
<%@tag import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@tag import="org.kl.bf.service.basic.UserService"%>
<%@tag import="org.kl.bf.entity.basic.User"%>
<%@attribute name="userId" type="java.lang.Object" required="true"%>
<%
  Object userId = jspContext.getAttribute("userId");
  if (userId == null) {
    out.print("");
  } else {
    ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(application);
    UserService userService = ctx.getBean(UserService.class);
    try {
    	User user = userService.getUser(userId.toString());
      out.print(user==null?"":user.getTrueName());
    } catch(Exception ex) {
      System.out.println(userId);
    }
  }
%>
